#ifndef     __CONN_TYPE_H
#define     __CONN_TYPE_H

#include <stdint.h>
#include "../build/config.h"

namespace conn {
    
namespace addr {
    constexpr uint8_t IPC = 0; // 工控机
    constexpr uint8_t MASTER = 1; // 总控板
    constexpr uint8_t ICE = 2; // 制冰
    constexpr uint8_t PICK = 3; // 取物门
    constexpr uint8_t HEAT = 4; // 加热
    constexpr uint8_t ARM = 5; // 机械臂
    constexpr uint8_t POWDER = 6; // 粉料架
    constexpr uint8_t PEARL = 7; // 珍珠
};

enum class ConnType : uint8_t {
    RS232 = 1,
    CAN = 2,
    RS485 = 3,
};

#ifdef BOARD_PIPE_LINE
constexpr uint8_t MY_ADDR = addr::MASTER;
#endif

#ifdef BOARD_ICE
constexpr uint8_t MY_ADDR = addr::ICE;
#endif

#ifdef BOARD_PICK
constexpr uint8_t MY_ADDR = addr::PICK;
#endif

#ifdef BOARD_HEAT
constexpr uint8_t MY_ADDR = addr::HEAT;
#endif

#ifdef BOARD_ARM
constexpr uint8_t MY_ADDR = addr::ARM;
#endif

#ifdef BOARD_POWDER
constexpr uint8_t MY_ADDR = addr::POWDER;
#endif

#ifdef BOARD_PEARL
constexpr uint8_t MY_ADDR = addr::PEARL;
#endif

constexpr uint32_t CAN_FILTER_LOCAL_VAL = ((MY_ADDR << 16) << 3) + 0x04;
constexpr uint32_t CAN_FILTER_LOCAL_MASK = ((0x0F << 16) << 3) + 0x04;

constexpr uint32_t CAN_FILTER_IPC_VAL = ((addr::IPC << 16) << 3) + 0x04;
constexpr uint32_t CAN_FILTER_IPC_MASK =((0x0F << 16) << 3) + 0x04;

constexpr uint32_t CAN_FILTER_ARM_VAL = 0x00;
constexpr uint32_t CAN_FILTER_ARM_MASK = 0x04;


}


#endif
